<form class="layui-form " action="" lay-filter="dataForm">
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label">帮会名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入帮会名称" class="layui-input">
        </div>
    </div> 
    <div class="layui-form-item">
        <label class="layui-form-label">所属客服</label>
        <div class="layui-input-inline">
            <select name="csid">
                <option value=""></option> 
                {volist name="cs_list" id="vo"}
                <option value="{$vo.id}" {$vo.id==$info.csid?'selected':''}>{$vo.username}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">帮会分类</label>
        <div class="layui-input-inline">
            <select name="type_id">
                <option value=""></option>
                {volist name="type_list" id="vo"}
                <option value="{$vo.id}" {$vo.id==$info.type_id?'selected':''}>{$vo.name}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">会长邀请码</label>
        <div class="layui-input-inline">
            <img src="/index/getJoinGangQrcode?user_id={$info.user_id}" alt="">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="dataSubmit">保存</button>
        </div>
    </div>
</form>
<script>
    layui.use(['form', 'http', 'laydate'], function () {
        var form = layui.form;
        var http = layui.http;
        var $ = layui.$;
        var laydate = layui.laydate;
        laydate.render({
            elem: '#time',
            type: 'datetime'
        });

        //表单初始赋值
        form.val('dataForm', {
            "id": "{$info.id}",
            "name": "{$info.name}",
        })
        //监听提交
        form.on('submit(dataSubmit)', function (data) {
            http.post('/gang/gangedit', data.field, function (res) {
                if (res.code == 0) {
                    parent.layui.table.reload('dataTable');
                    parent.layer.closeAll('page');
                }
            }, $(this))
            return false;
        })
    })
</script>